package com.minimalist.gateway.config;

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 指标监控配置
 *
 * @author minimalist
 */
@Configuration
public class MetricsConfig {

    @Bean
    public Timer requestLatencyTimer(MeterRegistry registry) {
        return Timer.builder("gateway.request.latency")
                .description("网关请求处理耗时")
                .register(registry);
    }
}